import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import path from 'path';
import AutoImport from 'unplugin-auto-import/vite';
import Components from 'unplugin-vue-components/vite';
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
// https://vitejs.dev/config/
export default defineConfig({
    resolve: {
        alias: {
            '@': path.resolve(__dirname, 'src')
        }
    },
    plugins: [
        vue(),
        AutoImport({
            resolvers: [ElementPlusResolver()]
        }),
        Components({
            // 配置elementPlus采用sass样式配置系统
            resolvers: [ElementPlusResolver({ importStyle: 'sass' })]
        })
    ],
    css: {
        preprocessorOptions: {
            scss: {
                // 自动导入定制化样式进行文件覆盖
                additionalData: `@use "@/styles/element.scss" as *;`
            }
        }
    }
});
